1. Field of the Invention
This invention relates to methods of detecting the direction of insertion of an endoscope, particularly to methods adapted to facilitate the insertion direction of an endoscope in the inspection field of a large intestine, possibly by automatic control.
2. Related Art Statement
Recently, there has been increasing use of endoscopes to enable organs within a body cavity to be observed by inserting an elongated insertion sheath. Various therapies can be applied by using medical tools inserted through a channel in the sheath as required.
In a conventional endoscope inspection, a doctor determines the advancing direction of the endoscope (insertion sheath) by observing the endoscope image.
However, a high degree of technical skill is required to insert an endoscope when inspecting the large intestine.
The applicants have proposed a method of detecting an endoscope insertion direction in which a dark region is extracted in an endoscope image and is considered an endoscope insertion direction in U.S. Pat. No. 4,910,590. In the method described in this patent, first of all, a quadtree with respect to the brightness level (gray level) is constructed by the steps shown in FIG. 9 of the patent mentioned above. That is, where the total pixels of the original picture number n.times.n, the average gray level of the region of 2.times.2 pixels is obtained and the quadtree is constructed by repeating the operations for obtaining an image of pixels of n/2.times.n/2 until the number of pixels becomes one. Thus, after the quadtree with respect to the gray level is constructed, a dark region is extracted by the steps shown in FIG. 14 of the patent mentioned above. That is to say, operations are carried out as follows. A node of the closest value to the required gray level is extracted in the order from the upper plane of the quadtree and then a node of the closest value to the required gray level is extracted from among four child nodes of this extracted node. Then, where the extracted node is included in a predetermined plane and also included within a predetermined range of the required gray level, it is examined whether the difference of the gray levels of four child nodes of the extracted node is included within a constant value or not. In the case where it is included within a constant value, the node is defined as the required dark region. On the other hand, where the difference of the gray level of four child nodes is not included within a constant value and also corresponds to the bottom plane which may be completed, "back-track" is carried out. This "back-track" is to return to the plane of an upper level and to examine the remaining three child nodes which belong to the same parent node as the extracted node.
Thus, in the method described in the patent mentioned above, when the dark region is extracted, erroneously determining the dark region, caused by a broken light fiber which forms an image guide of an endoscope, noise and others, to be the insertion direction, is prevented.
However, in some endoscope images, processing time becomes long by repeating the above mentioned back tracks several times, so that there is more room for improvement.